home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / Clipper.h < prev    next >
C/C++ Source or Header  |  1992-07-21  |  3KB  |  99 lines

  1. #ifndef Clipper_First
  2. #ifdef __GNUG__
  3. //pragma once
  4. #pragma interface
  5. #endif
  6. #define Clipper_First
  7.  
  8. #include "VObject.h"
  9.  
  10. enum ClipperFlags {
  11.     eClipperDefault  = eVObjDefault,
  12.     eClipperLast     = eVObjLast+0
  13. };
  14.  
  15. class Clipper: public VObject {
  16. protected:
  17.     Point minExtent, relOrigin;
  18.     float scale;
  19.     VObject *vop;                          // the VObject I show
  20.     Ink *bgcolor;
  21.     bool deleteVop;
  22.     
  23.     void FeedbackOnce(Command *tracker, Point ap, Point pp, bool turniton);
  24.     
  25.     Point Offset()
  26.     { return contentRect.origin - relOrigin; }
  27. public:
  28.     MetaDef(Clipper);
  29.     Clipper(VObject *vp= 0, Point minsize= gPoint_1, int id= cIdNone, Ink *bg= 0);
  30.     ~Clipper();
  31.     void SetDeleteVop(bool dv)
  32.     { deleteVop= dv; }
  33.     void Open(bool mode= TRUE);
  34.     void SetContainer(VObject*);
  35.     Metric GetMinSize();
  36.     void SetMinExtent(Point e);
  37.     Point GetMinExtent()
  38.     { return minExtent; }
  39.     void Focus();
  40.     void Enable(bool b= TRUE, bool redraw= TRUE);
  41.     VObject *Detect(BoolFun find, void *arg);
  42.     void SetBgInk(Ink *);
  43.     Ink *GetBgInk();
  44.     void ScaleUp(Point &p);
  45.     void ScaleDown(Point &p);
  46.     void SetZoom(float z);
  47.     float GetZoom()
  48.     { return scale; }
  49.     
  50.     //---- drawing ------------------------
  51.     void DrawInner(Rectangle, bool);
  52.     void DrawInFocus(VoidObjMemberFunc, Object*, void*, void*, void*, void*);
  53.     void Feedback(Object*, void*, void*, void*);
  54.     
  55.     //---- event handling -----------------
  56.     Command *DispatchEvents(Point lp, Token &t, Clipper *cl);
  57.     Point ContainerPoint(Point p);
  58.     bool TrackOnce(Command**, TrackPhase, Point, Point, Point);
  59.     Command *TrackInContent(Point, Token, Command*);
  60.     void SendDown(int, int, void*);
  61.     void Control(int, int, void*);
  62.     void ReadEvent(Token &t, int timeout= -1, bool overread= TRUE);
  63.     
  64.     //---- resize -------------------------
  65.     void SetExtent(Point e);
  66.     void SetOrigin(Point at);
  67.     void Normalize();
  68.     void ExtentChanged(VObject *what);
  69.     
  70.     //---- views --------------------------
  71.     void Add(VObject*);
  72.     VObject *Remove(VObject*);
  73.     void ViewSizeChanged();
  74.     Point GetViewSize();
  75.     Rectangle GetViewedRect();
  76.     VObject *GetViewedVObject()
  77.     { return vop; }
  78.     void InvalidateViewRect(Rectangle r);
  79.     
  80.     //---- scrolling ----------------------
  81.     Point GetRelOrigin()
  82.     { return relOrigin; }
  83.     virtual Point AutoScroll(Point);
  84.     virtual void Scroll(int mode, Point scroll, bool redraw= TRUE);
  85.     void RevealRect(Rectangle, Point);
  86.     void RevealAlign(Rectangle r, VObjAlign al= VObjAlign(eVObjHLeft+eVObjVTop));
  87.  
  88.     //---- input/output --------------------
  89.     OStream& PrintOn(OStream&);
  90.     IStream& ReadFrom(IStream&);
  91.  
  92.     //---- inspecting ----------------------
  93.     void InspectorId(char *buf, int sz);
  94.     void CollectParts(Collection*);
  95. };
  96.  
  97. #endif
  98.  
  99.